﻿using Nx.Kernel;
using Nx.Modules;
using Nx.Shell.ViewModels;
using Nx.UI.Navigation;
using Nx.ViewModels;
using System;

namespace Nx.Shell.WP7.Modules
{
    public class ShellModule : Module<ShellPages>
    {
        private Uri ShellPageUri = new Uri("/Nx.Shell.WP7;component/Pages/ShellPage.xaml", UriKind.Absolute);

        public override string Name
        {
            get { return "Shell Module"; }
        }

        public override void OnLoading()
        {
            this.Kernel.RegisterTypeIfMissing<IShellViewModel, ShellViewModel>(false);

            this.NavigationModel.Register<ShellViewModel>(ShellPages.ShellPage, new NavigationTarget(ShellPageUri));
        }
    }
}
